import java.io.*;
import java.util.Random;

public class GenNumber {
    public static void main(String[] args) {
        File file = new File("5316.txt");
        OutputStream out = null;
        try {
            out = new FileOutputStream(file);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        int n,i,rnd;
        n=316;
        Random rm=new Random();
        String s=new String();
        byte [] line = "\r\n".getBytes();
        for (i=0;i<n;i++){
            rnd=(rm.nextInt()%5316)+1;
            s = String.valueOf(rnd);
            System.out.println(s);
            byte[] b = s.getBytes();
            try{
                out.write(b);
                out.write(line);
            }
            catch (FileNotFoundException e) {
                e.printStackTrace();
                System.out.println("Something wrong");
            } catch (IOException e) {
            e.printStackTrace();
            System.out.println("wrong");
        }
    }
    }
}
